package newtank.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author lijiahao
 * @since 2022/3/18
 */
public class ExecutorsUtils {

    private final static ScheduledExecutorService paintService = Executors.newScheduledThreadPool(1);
    private final static ExecutorService bussService = Executors.newFixedThreadPool(400);

    public static void executeRepaint(Runnable runnable) {
        paintService.scheduleAtFixedRate(runnable, 0, 10, TimeUnit.MILLISECONDS);
    }

    public static void execute(Runnable runnable) {
        bussService.execute(runnable);
    }

}
